//
//  KLEngine.h
//  WebRTCDemo_iOS
//
//  Created by szblsx2 on 2020/3/5.
//  Copyright © 2020 szblsx2. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "KLClient.h"


NS_ASSUME_NONNULL_BEGIN

@interface KLEngine : NSObject
//事件回调
@property (nonatomic, copy) void(^eventHandleBlock)(NSDictionary *response);

/**
*  初始化连接器
*  @param server 信令服务器地址
*  @param port     端口号
*  @param name 用户名
*/
- (void)initEngineWithServer:(NSString *)server port:(NSString *)port name:(NSString *)name;


/**
*  设置turn转发服务器地址 如不设置则为默认地址
*  @param iceServers  服务器地址
*/
- (void)setupIceServers:(NSArray<RTCIceServer *> *)iceServers;

/**
*  设置视频渲染窗口
*  @param videoRenderer  视频渲染窗口
*/
- (void)setupVideoRenderer:(UICollectionView *)videoRenderer;

/**
*  创建会议
*  @param roomId 房间id
*/
- (void)createMeetingWithRoomId:(NSString *)roomId;

/**
*  加入会议
*  @param roomId 房间id
*/
- (void)joinMeetingWithRoomId:(NSString *)roomId;

/**
*  离开会议
*/
- (void)leaveMeeting;

/**
*  释放工厂对象
*/
- (void)freeSdk;

/**
*  是否打开摄像头 默认开启
*  @param open 是否开启
*/
- (void)turnOnCamera:(BOOL)open;

/**
*  切换前后置摄像头 默认前置
*/
- (void)switchCamera;

/**
*  是否打开麦克风 默认开启
*  @param open 是否开启
*/
- (void)turnOnMicrophone:(BOOL)open;

/**
*  是否开启扬声器
*  @param open 默认开启
*/
- (void)whetherToOpenLoudspeaker:(BOOL)open;

- (void)test1;


@end

NS_ASSUME_NONNULL_END
